package com.lg.template.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.ToString;

import java.util.Date;

@Data
@ToString
//配合配置文件中的包别名使用
//@Alias("user")
public class User {

    //默认为雪花算法生成
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private String pwd;
    private String password;
    private String info;
    private byte[] headImg;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    //乐观锁
    // 初始化：将数据库此字段默认设置为 1
    @Version
    private Integer version;

}
